package tech.aistar.clothesspringboot.mapper;


import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import tech.aistar.clothesspringboot.pojo.RentOrder;


import java.util.List;

@Mapper
public interface RentOrderMapper {
    //根据用户id
    @Select("select * from rent_order where user_id = #{userId}")
    List<RentOrder> getRentOrderByUserId(Integer userId);
    //根据user_id添加订单
    @Insert("insert into rent_order (user_id,order_no,rent_start_time,rent_end_time,total_days,total_price,deposit,pay_status,order_status,remark,create_time) values (#{userId},#{orderNo},#{rentStartTime},#{rentEndTime},#{totalDays},#{totalPrice},#{deposit},#{payStatus},#{orderStatus},#{remark},#{createTime})")
    int insertRentOrderByUserId(RentOrder rentOrder);
}
